<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\models\YdSyncLog;

/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\SearchYdSyncLog */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '云店日志管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="yd-sync-log-index">
     <?= common\components\grid\GridView2015::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
    	'title' => $this->title,
    	'panel' => [
    		'before' => Html::a('<i class="glyphicon glyphicon-remove"></i> 清空日志', ['clear'], ['class' => 'btn btn-success', 'style' => 'margin-left:20px;'])
    	],
        'columns' => [
            ['class' => 'common\components\grid\CheckboxColumn2015'],
            ['class' => 'common\components\grid\SerialColumn2015'],
     		
     		'goods_id',
     		'goods_name',
     		'message',
     		[
     		'attribute' => 'log_type',
     		'filter' => ['1'=>'全量同步','2'=>'增量同步价格','3'=>'增量同步库存','4'=>'增量上架','5'=>'增量下架'],
     		'value'=>function($searchModel){ return YdSyncLog::getTypes($searchModel->log_type);}
     		],
     		[
     		'attribute' => 'system',
     		'filter' => f_p('system')
     		],
     		'site_id',
     		[
     		'attribute' => 'log_time',
     		'value'=>function($searchModel){ return date('Y-m-d H:i:s', $searchModel->log_time);}
     		],
            'ip',
            // 'server',
            // 'user_id',
            // 'user_name',

            [
            	'class' => 'common\components\grid\ActionColumn2015',
            	'template' => '{view}',
    		]
        ],
    ]); ?>

</div>
